package com.findu.fragment;

import com.example.findu.More_Home_Manage;
import com.example.findu.R;
import com.example.findu.R.id;
import com.example.findu.R.layout;
import com.findu.activity.Home_More_Personal;
import com.findu.control.Public_title;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.webkit.WebView.FindListener;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

/**
 * 
 * @ClassName: Fragment_Conversation_More_5
 * @Description: TODO(更多页面)
 * @author hgf
 * @date 2015-11-4 上午11:03:49
 * 
 */
public class Fragment_Conversation_More_5 extends Fragment implements
		OnClickListener {
	private View fragmentView;
	private TextView More_Text_Name, more_textView_liveness; // 声明用户名、活跃度
	
	//声明意图方便跳转
	private Intent intent;

	// 布局中的控件
	private LinearLayout more_Top_name_LinearLayout;
	private LinearLayout more_HomeMap_ManageLinearlayout;
	private LinearLayout more_NewYearsmoneyLinearlayout;
	private LinearLayout more_dandelion_moneyLinearlayout;
	private LinearLayout more_about_FindULinearlayout;

	// 标题控制
	Public_title public_title; 
	// 声明title布局
	private View include_view;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// 引入并得到view
		fragmentView = inflater.inflate(
				R.layout.fragment__conversation__more_5, container, false);

		// /初始化title
		init_title();

		// 初始化控件
		init_control();

		return fragmentView;
	}

	/**
	 * 初始化控件
	 */
	private void init_control() {
		// 初始化姓名和活跃度
		More_Text_Name = (TextView) fragmentView
				.findViewById(R.id.More_Text_Name);
		more_textView_liveness = (TextView) fragmentView
				.findViewById(R.id.more_textView_liveness);

		// 初始化布局
		more_Top_name_LinearLayout = (LinearLayout) fragmentView.findViewById(R.id.more_Top_name_LinearLayout);
		more_HomeMap_ManageLinearlayout = (LinearLayout) fragmentView
				.findViewById(R.id.more_HomeMap_ManageLinearlayout);
		more_NewYearsmoneyLinearlayout = (LinearLayout) fragmentView
				.findViewById(R.id.more_NewYearsmoneyLinearlayout);
		more_dandelion_moneyLinearlayout = (LinearLayout) fragmentView
				.findViewById(R.id.more_dandelion_moneyLinearlayout);
		more_about_FindULinearlayout = (LinearLayout) fragmentView
				.findViewById(R.id.more_about_FindULinearlayout);
		
		//绑定监听事件
		more_Top_name_LinearLayout.setOnClickListener(this);
		more_HomeMap_ManageLinearlayout.setOnClickListener(this);
		more_NewYearsmoneyLinearlayout.setOnClickListener(this);
		more_dandelion_moneyLinearlayout.setOnClickListener(this);
		more_about_FindULinearlayout.setOnClickListener(this);
	}

	/**
	 * 初始化title
	 */
	private void init_title() {
		// 初始化title
		include_view = fragmentView
				.findViewById(R.id.fragment_conversation_page5_include);
		public_title = new Public_title(include_view); // 新建工具类设置布局控件

		public_title.setTextView("更多");
	}

	/**
	 * 监听事件
	 */
	@Override
	public void onClick(View arg0) {
		// TODO Auto-generated method stub
		//初始化意图
		switch (arg0.getId()) {
		case R.id.more_Top_name_LinearLayout:
			intent = new Intent(getActivity(),new Home_More_Personal().getClass());
			startActivity(intent);
			break;
		case R.id.more_HomeMap_ManageLinearlayout:
			intent = new Intent(getActivity(),new More_Home_Manage().getClass());
			startActivity(intent);
			break;
		case R.id.more_NewYearsmoneyLinearlayout:
			Toast.makeText(getActivity(), "ok", Toast.LENGTH_SHORT).show();
			break;
		case R.id.more_dandelion_moneyLinearlayout:
			Toast.makeText(getActivity(), "ok", Toast.LENGTH_SHORT).show();
			break;
		case R.id.more_about_FindULinearlayout:
			Toast.makeText(getActivity(), "ok", Toast.LENGTH_SHORT).show();
			break;

		default:
			break;
		}
	}

}
